/**
 * Created by Administrator on 2019/5/18 0018.
 */
/* //添加圆柱
 //id：服务化平台给出的UUID，字符串
 //name：圆柱体名称
 //point：圆柱体体心 [经,纬,高]（[100.0, 40.0, 200000.0]）
 //length：柱面长度
 //topRadius：圆柱顶部半径
 //bottomRadius：圆柱底部半径
 //fillColor：圆柱体填充颜色，数组：[R,G,B,255]（[255, 0, 0, 128]）
 //isFilled：圆柱体是否填充，true or false
 //isOutline：圆柱体是否显示轮廓，true or false
 //outlineColor：圆柱体轮廓颜色，数组：[R,G,B,255]（[255,0,0,255]） */
import CZML_GENERALTOOLS_CLASS from "./../main/CZML_GENERALTOOLS_CLASS.js"

class CZML_Cylindrical {
    constructor(viewer, id, name, point, length, topRadius, bottomRadius, fillColor, isFilled, isOutline, outlineColor) {
        this._viewer = viewer
        this.id = id
        this.name = name
        this.point = point
        this.length = length
        this.topRadius = topRadius
        this.bottomRadius = bottomRadius
        this.fillColor = fillColor
        this.isFilled = isFilled
        this.isOutline = isOutline
        this.outlineColor = outlineColor
        this.Cylinder = {
            id: id,
            name: name,
            position: {
                cartographicDegrees: point
            },
            cylinder: {
                length: length,
                topRadius: topRadius,
                bottomRadius: bottomRadius,
                material: {
                    solidColor: {
                        color: {
                            rgba: fillColor
                        }
                    }
                },
                fill: isFilled,
                outline: isOutline,
                outlineColor: {
                    rgba: outlineColor
                }
            }
        }
        this.CZML_AddCylindrical()
    }

    CZML_AddCylindrical() {
        // 插入该数据对象
        const ret = CZML_GENERALTOOLS_CLASS.InsertModelObjectInformation(this.id, this.Cylinder, true)
        // 上图
        CZML_GENERALTOOLS_CLASS.Upper(this._viewer)
        return ret
    }
}
export default CZML_Cylindrical
